#ifndef ESTATISTICA_H_
#define ESTATISTICA_H_

#include <iostream>
#include <string>
#include <fstream>
#include <sstream>
#include <boost/thread/mutex.hpp>

using namespace std;  //temporario aqui

class Estatistica{
public:
        Estatistica(){};
        ~Estatistica(){ efile.close(); };
        void setFile(string name){
                name = "./out_logger/" + name;
                efile.open(name.c_str(), ios_base::app);
        };
        void addData(unsigned long int a, unsigned long int b){
                boost::mutex::scoped_lock addDatalock(mutexEstatisticaData);
                string outData;
                stringstream sa, sb;
                sa << a;
                sb << b;

                outData = sa.str() + " " + sb.str();
                cout << outData << endl;
                efile << outData << endl;

        };
private:
        ofstream efile;
        static boost::mutex mutexEstatisticaData;
};

#endif /*ESTATISTICA_H_*/

